// Fill out your copyright notice in the Description page of Project Settings.


#include "Character/Core/RuleCharacter.h"

#include "Components/ArrowComponent.h"
#include "Components/BoxComponent.h"
#include "Components/WidgetComponent.h"


ARuleCharacter::ARuleCharacter()
{
	PrimaryActorTick.bCanEverTick = true;

	HomingPoint = CreateDefaultSubobject<USceneComponent>(TEXT("HomingPoint"));
	Widget = CreateDefaultSubobject<UWidgetComponent>(TEXT("Widget"));
	OpenFirePoint = CreateDefaultSubobject<UArrowComponent>(TEXT("FirePoint"));
	TraceShowCharacterInformation = CreateDefaultSubobject<UBoxComponent>(TEXT("TraceBox"));

	// HomingPoint->SetupAttachment(RootComponent);
	HomingPoint->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
	Widget->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
	OpenFirePoint->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
	TraceShowCharacterInformation->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);

	// 碰撞通道设置
	TraceShowCharacterInformation->SetCollisionProfileName(TEXT("Scanning"));
	TraceShowCharacterInformation->SetBoxExtent(FVector(38, 38, 100));
}


void ARuleCharacter::BeginPlay()
{
	Super::BeginPlay();
	
}


void ARuleCharacter::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

float ARuleCharacter::TakeDamage(float DamageAmount, FDamageEvent const& DamageEvent, AController* EventInstigator,
	AActor* DamageCauser)
{
	return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
}


bool ARuleCharacter::IsDeath()
{
	return false;
}

float ARuleCharacter::GetHealth()
{
	return 0.0f;
}

float ARuleCharacter::GetMaxHealth()
{
	return 0.0f;
}

bool ARuleCharacter::IsTeam()
{
	return false;
}

EGameCharacterType::Type ARuleCharacter::GetType()
{
	return EGameCharacterType::MAX;
}


